package com.itheima.thread;

public class Demo07 {
    public static void main(String[] args) {

        Thread t1 = new Thread(() -> {
            String name = Thread.currentThread().getName();
            for (int i = 0; i < 100; i++) {
                System.out.println(name + "执行到了" + i);
            }

        });
        Thread t2 = new Thread(() -> {
            String name = Thread.currentThread().getName();
            for (int i = 0; i < 100; i++) {
                System.out.println(name + "执行到了" + i);
            }

        });
        t1.setName("lihong");
        t2.setName("yundi");
        t1.setPriority(6);
        t2.setPriority(5);
        t1.start();
        t2.start();

    }

}
